package com.pi.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class MySql {
    public static Connection getConnection(){
        String driverName="com.mysql.jdbc.Driver";
        String url="jdbc:mysql://localhost:3306/pi?useUnicode=true&characterEncoding=UTF-8";
        String user="zlj";
        String password="zlj123";
        Connection connection=null;
        try {
            Class.forName(driverName);
            connection= DriverManager.getConnection(url,user,password);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return connection;
    }
}
